<template>
	<view class="container">
		<view class="vip_bg">
			<view class="vip-msg">
				<image @click="changUser" src="/static/image/Index/index-active2.png" mode="" class="vip-touxiang">
				</image>
				<view class="vip-name">
					<view class="name-name">昵称</view>
					<view class="name-bot">开通会员享受专属特权</view>
					<!-- <view class="name-bot">有效期至2025-08-12</view> -->
				</view>
				<view class="open-vipbtn" @click="paySuccess">立即开通</view>
				<!-- <view class="open-vipbtn"  @click="paySuccess">立即续费</view> -->
			</view>
		</view>
		<view class="vip_list">
			<view class="listwenzi">开通会员</view>
			<view class="point-list">
				<view :class="[currentTab==index?'point-itemed':'']" class="point-item"
					v-for="(item,index) in pointList" :key="index" @click="switchTab(index)">
					<view class="item-fen" :class="[currentTab==index?'item-fened':'']">{{item.time}}</view>
					<view class="item-fenkuang" :class="[currentTab==index?'item-fenkuanged':'']">
						<view class="item-jiage">￥<span style="font-size: 48rpx;">{{item.money}}</span></view>
						<view class="item-jine">约￥{{item.about}}/月</view>
					</view>
				</view>
			</view>
			<view class="listwenzi">会员特权</view>
			<view class="point-list">
				<view class="te_list">
					<image src="/static/image/Index/vip-xunzhang.png" mode="" class="te-icon"></image>
					<view>
						<view class="te_name">会员勋章</view>
						<view class="te_ms">全平台会员勋章</view>
					</view>
				</view>
				<view class="te_list">
					<image src="/static/image/Index/vip-lianghao.png" mode="" class="te-icon"></image>
					<view @click="updateName">
						<view class="te_name">会员靓号</view>
						<view class="te_ms">可设置专属ID彰显身份</view>
					</view>
				</view>
				<view class="te_list">
					<image src="/static/image/Index/vip-chakan.png" mode="" class="te-icon"></image>
					<view>
						<view class="te_name">访客查看</view>
						<view class="te_ms">查看所有来访记录</view>
					</view>
				</view>
				<view class="te_list">
					<image src="/static/image/Index/vip-shaixuan.png" mode="" class="te-icon"></image>
					<view>
						<view class="te_name">高级筛选</view>
						<view class="te_ms">筛选心仪的TA</view>
					</view>
				</view>
				<view class="te_list">
					<image src="/static/image/Index/vip-siliao.png" mode="" class="te-icon"></image>
					<view @click="openSiliao">
						<view class="te_name">免费私聊</view>
						<view class="te_ms">每日赠送3次，可...></view>
					</view>
				</view>
				<view class="te_list">
					<image src="/static/image/Index/vip-shezhi.png" mode="" class="te-icon"></image>
					<view>
						<view class="te_name">隐私设置</view>
						<view class="te_ms">隐藏位置和在线状态</view>
					</view>
				</view>
				<view class="te_list">
					<image src="/static/image/Index/vip-jiesuo.png" mode="" class="te-icon"></image>
					<view @click="openJieWx">
						<view class="te_name">解锁微信</view>
						<view class="te_ms">每日赠送3次，可...></view>
					</view>
				</view>

			</view>

			<view class="te-xieyi">
				<radio color="#000" @click="checkedTe" style="transform:scale(0.7);" :checked="checkBuTe" />
				开通成功即代表您同意 <span @click="handleVipXY">《会员服务协议》</span>
			</view>

			<view class="paybtn" @click="paySuccess">立即开通享赠送福利</view>
		</view>

		<!-- 查看免费私聊弹框 -->
		<uni-popup class="select_popup" ref="popupVipWxNum" :mask-click="true" type="center">
			<view class="wxNumVipPopup">
				<view class="seeWX">免费私聊</view>
				<view class="wxVipNumtxt">
					VIP用户每日赠送3次，赠送次数0点刷新
					可解锁非星选达人用户
				</view>
				<view class="book_btn">
					<view class="bookclose" @click="closeVipWxNum">我知道了</view>

				</view>
			</view>
		</uni-popup>

		<!-- 查看解锁微信弹框 -->
		<uni-popup class="select_popup" ref="popupWxNum" :mask-click="true" type="center">
			<view class="wxNumVipPopup">
				<view class="seeWX">解锁微信</view>
				<view class="wxVipNumtxt">
					VIP用户每日赠送3次，赠送次数0点刷新
					可解锁非星选达人用户
				</view>
				<view class="book_btn">
					<view class="bookclose" @click="closeWxNum">我知道了</view>
				</view>
			</view>
		</uni-popup>

		<!-- 修改昵称弹框 -->
		<uni-popup class="select_popup" ref="popupNameWxNum" :mask-click="true" type="center">
			<view class="wxNumPopup">
				<view class="seeWX">会员靓号</view>
				<view class="wxNumtxt">
					VIP用户90天内只能修改一次
				</view>
				<view class="book_btn">
					<view class="bookclose" @click="closeNameWxNum">取消</view>
					<view class="booksubBuy" @click="openUpdateName">去修改</view>
				</view>
			</view>
		</uni-popup>

	</view>

</template>

<script>
	export default {

		data() {
			return {
				currentTab: 0,
				pointList: [{
						time: '1个月',
						money: '39',
						about: '39'
					},
					{
						time: '3个月',
						money: '99',
						about: '33'
					},
					{
						time: '1年',
						money: '299',
						about: '22'
					},

				],
				checkBuTe: false,


			}
		},
		methods: {
			// 修改头像
			changUser(){
				let that = this;
				uni.showModal({
					// title: '免费私聊',
					title: '解锁微信',
					content: 'VIP用户每日赠送3次，赠送次数0点刷新可解锁非星选达人用户',
					confirmColor: "#000000",
					// showCancel:'false',
					confirmText:'我知道了',
					success: (res) => {
						if (res.confirm) {
						}
					}
				})
				// uni.showModal({
				// 	title: '会员靓号',
				// 	content: ' VIP用户90天内只能修改一次 ',
				// 	confirmColor: "#000000",
				// 	cancelColor: "#999999",
				// 	confirmText:'去修改',
				// 	success: (res) => {
				// 		if (res.confirm) {
				// 			 that.$helper.to('/pages/views/openVip/updateName')
				// 		}
				// 	}
				// })
			},
			switchTab(index) {
				this.currentTab = index;
			},
			checkedTe() {
				this.checkBuTe = !this.checkBuTe
			},
			closeVipWxNum() {
				this.$refs.popupVipWxNum.close()
			},
			openSiliao() {
				this.$refs.popupVipWxNum.open()
			},
			openJieWx() {
				this.$refs.popupWxNum.open()
			},
			closeWxNum() {
				this.$refs.popupWxNum.close()
			},
			updateName() {
				this.$refs.popupNameWxNum.open()
			},
			closeNameWxNum() {
				this.$refs.popupNameWxNum.close()
			},
			paySuccess() {
				if (this.checkBuTe == false) {
					uni.showModal({
						title: '提示',
						content: ' 请勾选并同意《会员服务协议》？',
						confirmColor: "#000000",
						cancelColor: "#999999",
						success: (res) => {
							if (res.confirm) {
								this.checkBuTe = true
							}
						}
					})
					return
				}

				this.$helper.to('/pages/tabBar/index/pay')
			},
			openUpdateName() {
				this.$refs.popupNameWxNum.close()
				this.$helper.to('/pages/views/openVip/updateName')
			},
			handleVipXY() {
				this.$helper.to('/pages/views/openVip/vipXY')
			},
		},
	}
</script>

<style lang="scss" scoped>
	page {
		background: #fff;
	}

	.container {
		width: 100%;
	}

	.select_popup {
		z-index: 9999;
		width: 100%;

		// 查看私聊
		.wxNumVipPopup {
			background-color: #fff;
			width: 600rpx;
			height: 352rpx;
			border-radius: 30rpx;

			.seeWX {
				font-size: 32rpx;
				color: #000;
				text-align: center;
				padding-top: 40rpx;
			}

			.wxVipNumtxt {
				text-align: center;
				width: 482rpx;
				height: 124rpx;
				font-size: 28rpx;
				color: #666;
				margin: 0 auto;
				margin-top: 48rpx;

				span {
					color: #ff0000;
				}
			}

			.book_btn {
				height: 96rpx;
				border-top: 1px solid #f8f8f8;

				.bookclose {
					height: 96rpx;
					line-height: 96rpx;
					font-size: 32rpx;
					color: #000;
					text-align: center;

				}

				.booksubBuy {
					display: flex;
					align-items: center;
					justify-content: center;
					width: 299rpx;
					height: 96rpx;
					color: #000;
					line-height: 96rpx;
					text-align: center;
					font-size: 32rpx;

					image {
						width: 28rpx;
						height: 28rpx;
					}
				}
			}
		}

		// 查看微信号
		.wxNumPopup {
			background-color: #fff;
			width: 600rpx;
			height: 301rpx;
			border-radius: 30rpx;

			.seeWX {
				font-size: 32rpx;
				color: #000;
				text-align: center;
				padding-top: 40rpx;
			}

			.wxNumtxt {
				height: 122rpx;
				display: flex;
				font-size: 28rpx;
				color: #666;
				justify-content: center;
				line-height: 122rpx;

			}

			.book_btn {
				display: flex;
				align-items: center;
				height: 96rpx;
				border-top: 1px solid #f8f8f8;

				.bookclose {
					width: 300rpx;
					height: 96rpx;
					line-height: 96rpx;
					font-size: 32rpx;
					color: #999;
					text-align: center;
					border-right: 1px solid #f8f8f8;
				}

				.booksubBuy {
					display: flex;
					align-items: center;
					justify-content: center;
					width: 299rpx;
					height: 96rpx;
					color: #000;
					line-height: 96rpx;
					text-align: center;
					font-size: 32rpx;

					image {
						width: 28rpx;
						height: 28rpx;
					}
				}
			}
		}
	}

	.vip_bg {
		position: relative;
		width: 100%;
		height: 390rpx;
		background: url("/static/image/Index/vip-bg.png");
		background-size: cover;
		background-position: center;
		background-repeat: no-repeat;
	}

	.vip-msg {
		display: flex;
		align-items: center;
		position: absolute;
		bottom: 30rpx;
		left: 30rpx;
	}

	.vip-touxiang {
		width: 100rpx;
		height: 100rpx;
	}

	.vip-name {
		margin-left: 24rpx;
	}

	.name-name {
		font-size: 36rpx;
		color: #D8752D;
	}

	.name-bot {
		font-size: 24rpx;
		color: #D8752D;
		margin-top: 12rpx;
	}

	.open-vipbtn {
		width: 180rpx;
		height: 60rpx;
		border-radius: 33rpx;
		background: url('/static/image/Index/vip-btnbg.png');
		background-size: cover;
		background-position: center;
		background-repeat: no-repeat;
		text-align: center;
		line-height: 60rpx;
		font-size: 26rpx;
		color: #fff;
		margin-left: 146rpx;
		margin-top: 28rpx;
	}

	.vip_list {
		margin-top: 48rpx;
		padding-bottom: 68rpx;

		.listwenzi {
			margin-left: 30rpx;
			font-size: 28rpx;
			color: #333333;
		}


	}

	.point-list {
		display: flex;
		align-items: center;
		flex-wrap: wrap;
		margin-top: 30rpx;
	}

	.point-item {
		width: 210rpx;
		height: 262rpx;
		border-radius: 20rpx;
		border: 1px solid #CCCCCC;
		margin-left: 30rpx;
		margin-bottom: 30rpx;
	}

	.point-itemed {
		border: 1px solid #DCA54F;
	}

	.item-fen {
		height: 62rpx;
		font-size: 28rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		background: #CCCCCC;
		border-radius: 20rpx 20rpx 0 0;
		color: #fff;

	}

	.item-fened {
		background: #DCA54F;
	}

	.item-fenkuang {
		height: 200rpx;
		border-radius: 0 0 20rpx 20rpx;
	}

	.item-fenkuanged {
		background: rgba(254, 201, 47, 0.10);
	}

	.item-jiage {
		font-size: 28rpx;
		text-align: center;
		padding-top: 40rpx;
		font-weight: 500;
	}

	.item-jine {
		font-size: 24rpx;
		text-align: center;
		margin-top: 10rpx;
		color: #999;
	}

	.te_list {
		display: flex;
		align-items: center;
		width: 330rpx;
		height: 80rpx;
		margin-left: 30rpx;
		margin-bottom: 30rpx;
	}

	.te-icon {
		width: 80rpx;
		height: 80rpx;
		border-radius: 50%;
		margin-right: 16rpx;
	}

	.te_name {
		font-size: 24rpx;
		color: #333;
	}

	.te_ms {
		font-size: 22rpx;
		margin-top: 8rpx;
		color: #999;
		width: 220rpx;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.te-xieyi {
		display: flex;
		align-items: center;
		justify-content: center;
		margin-top: 48rpx;
		padding-bottom: 30rpx;
		color: #999;
		font-size: 24rpx;

		span {
			color: #000;
		}
	}

	.paybtn {
		margin: 0 auto;
		width: 690rpx;
		height: 90rpx;
		border-radius: 49rpx;
		background: #000;
		line-height: 90rpx;
		color: #FEC92F;
		font-size: 32rpx;
		text-align: center;

	}
</style>